package com.siwei.mes.service.sync.tc;

import com.github.pagehelper.PageInfo;
import com.siwei.mes.common.query.PageQuery;
import com.siwei.mes.common.validator.PageGroup;
import com.siwei.mes.entity.sync.tc.Waybill;
import com.siwei.mes.entity.sync.tc.WaybillEntity;
import com.siwei.mes.entity.vo.WaybillVo;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * 砼材-运单(Waybill)表服务接口
 *
 * @author linzi
 * @since 2024-05-22 21:08:28
 */
public interface WaybillService {
    /**
     * 新增
     *
     * @param entity
     * @return
     */
    Long create(Waybill entity);

    /**
     * 修改
     *
     * @param entity
     */
    void update(Waybill entity);

    /**
     * 删除
     *
     * @param id
     */
    void delete(Long id);

    /**
     * 获取所有分组  分页
     *
     * @param query
     * @return
     */
    PageInfo<Waybill> getPage(PageQuery<Waybill, Waybill> query);

    /**
     * 获取所有分组  分页
     *
     * @param query
     * @return
     */
    PageInfo<Waybill> bindPage(PageQuery<Waybill, Waybill> query);

    /**
     * 根据id查询
     *
     * @param id
     * @return
     */
    Waybill loadById(Long id);

    /**
     * 获取所有
     *
     * @param entity
     * @return
     */
    List<Waybill> getAll(Waybill entity);

    /**
     * 根据供货任务单ID获取所有运单
     *
     * @param experimentId
     * @param supplyTaskId
     * @return
     */
    List<Waybill> selectByExperimentId(Long experimentId,Long supplyTaskId);

    /**
     * 根据供货任务单ID获取所有运单
     *
     * @param query
     * @return
     */
    PageInfo<Waybill> selectByExperimentIdPage(@RequestBody @Validated(PageGroup.class) PageQuery<WaybillVo, WaybillVo> query);

    /**
     * 根据供货任务单ID获取所有运单
     *
     * @param waybillEntity
     * @return
     */
    void  batchGenerateExperiment(WaybillEntity waybillEntity);
}
